package com.chandra.pos.order.dao.entity;

/**
 * Created by IntelliJ IDEA.
 * Customer: root
 * Date: 3/22/13
 * Time: 1:08 AM
 * To change this template use File | Settings | File Templates.
 */
public enum PaymentType {

    KG(0, "KG"),
    Bag(1, "Bag"),
    MT(2, "MT"),
    PC(3, "PC"),
    Liter(4, "Liter");

    private final int id;

    private final String name;

    PaymentType(int id, String name) {
        this.id = id;
        this.name = name;

    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public PaymentType getType(int id) {

        PaymentType[] types = PaymentType.values();

        for (PaymentType type : types) {
            if (type.getId() == id)
                return type;
        }
        return null;
    }
}
